<script type="text/javascript">
$(function() {
	$('[name=cpf]').mask('999.999.999-99');
	$('[name=cep]').mask('99999-999');
	$('[name=data_nascimento]').mask('99/99/9999');
})
</script>
<div class="content-box"><!-- Start Content Box -->
    
    <div class="content-box-header">
        
        <h3>Estudantes (<?php echo $total;?>)</h3>
        
  <ul class="content-box-tabs">
            <li><a href="#tab1" class="<?php echo $tab_lista;?>">Cadastrados</a></li> <!-- href must be unique and match the id of target div -->
            <li><a href="#tab2" class="<?php echo $tab_form;?>"><?php echo $editar_novo;?></a></li>
        </ul>
        
        <div class="clear"></div>
        
    </div> <!-- End .content-box-header -->
    
    <div class="content-box-content">
        
        <div class="tab-content <?php echo $tab_lista;?>" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
            
         	<div class="notification <?php echo $css_mensagens;?> png_bg" <?php echo $display_mensagens;?>>
                <a href="#" class="close"><img src="{base_url}/_img/admin/icons/cross_grey_small.png" title="Fechar esta notifica&ccedil;&atilde;o" alt="Fechar" /></a>
                <div>
                    <?php echo $mensagem;?>
                </div>
            </div>            
		    <form action="" method="post" id="formLista">
            <table>
                
                <thead>
                    <tr>
                       <th style="width:5%;"><input class="check-all" type="checkbox" /></th>
                       <th style="width:auto;">CPF</th>
                       <th style="width:auto;">Nome</th>
                       <th style="width:6%;">A&ccedil;&otilde;es</th>
                    </tr>
                    
                </thead>
             
                <tfoot>
                    <tr>
                        <td colspan="4">
                            <div class="bulk-actions align-left">
                            	
                                <select name="dropdownAcoes">
                                    <option value="">Com os selecionados...</option>
                                    <option value="<?php echo site_url("admin/" . $nome_secao ."/apagaVarios")?>">Excluir</option>
                                </select>
                                 
                                <a class="button" id="btAcao" style="cursor: pointer;">Aplicar</a>
                            </div>
                            
                            <div class="pagination"><?php paginator($pagina, $limite, $total_paginas, 'admin/' . $nome_secao .'/' . $lista_busca . '/')?></div>
                            <div class="clear"></div>
                        </td>
                    </tr>
                </tfoot>
             
                <tbody>
				<?php
                if (empty($rs)) {
                ?>
                    <tr>
                        <td colspan="5">Nenhum registro cadastrado.</td>                        
                    </tr>
				<?php
                }
                else {
                foreach ((array)$rs as $registro) {
                    $id = $registro->slug;
                    $ativado = ($registro->ativo == 0) ? "des" : "";
                    $ativar = ($registro->ativo == 0) ? 1 : 0;
                ?>
                    <tr>
                        <td><input type="checkbox" name="ativo[]" value="<?php echo $id;?>" /></td>

                        <td><?php echo $registro->cpf;?></td>
                        <td><?php echo $registro->nome;?></td>
                        <td>
                            <!-- Icons -->
                             <a href="<?php echo site_url("admin/" . $nome_secao ."/edita/$id");?>" title="Editar"><img src="{base_url}/_img/admin/icons/pencil.png" alt="Editar" /></a>
                             <a href="<?php echo site_url("admin/" . $nome_secao ."/trataApaga/$registro->id_usuarios");?>" title="Excluir"><img src="{base_url}/_img/admin/icons/cross.png" alt="Excluir" /></a>
                        </td>                        
                    </tr>
				<?php
                    }
                }
                ?>
                </tbody>
            </table>

            </form>
           
        </div> <!-- End #tab1 -->
        
        <div class="tab-content <?php echo $tab_form;?>" id="tab2">

            <form id="moduloForm" action="<?php echo $action;?>" method="post">
                <fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
                   <p>
                        <label>CPF</label>
                        <input class="text-input medium-input {validate: {required: true, cpf: 'both'}}" type="text" name="cpf" value="<?php echo $r->cpf;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>Institui&ccedil;&atilde;o de ensino</label>
                        <?php echo form_dropdown('cnpj_instituicao', $instituicoes, $r->cnpj_instituicao);?>
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <input type="hidden" name="id_usuarios" value="<?php echo $r->id_usuarios;?>"/>
                   <p>
                        <label>Nome Completo do Estudante</label>
                        <input class="text-input medium-input {validate: {required: true}}" type="text" name="nome" value="<?php echo $r->nome;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
<?php
if (empty($r)) {
?>
                   <p>
                        <label>Login</label>
                        <input class="text-input small-input {validate: {required: true}}" type="text" name="login" value="<?php echo $r->login;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>Senha</label>
                        <input class="text-input small-input {validate: {required: true}}" type="password" name="senha" value="<?php echo $r->senha;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
<?php
}
?>
                   <p>
                        <label>Matr&iacute;cula</label>
                        <input class="text-input small-input {validate: {required: true}}" type="text" name="matricula" value="<?php echo $r->matricula;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>Idade</label>
                        <input class="text-input verysmall-input {validate: {required: true}}" type="text" name="idade" value="<?php echo $r->idade;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>RG</label>
                        <input class="text-input small-input {validate: {required: true}}" type="text" name="rg" value="<?php echo $r->rg;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>Data de Nascimento</label>
                        <input class="text-input {validate: {required: true}}" type="text" name="data_nascimento" value="<?php echo $r->data_nascimento;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>Endere&ccedil;o</label>
                        <input class="text-input small-input {validate: {required: true}}" type="text" name="endereco" value="<?php echo $r->endereco;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>N&uacute;mero</label>
                        <input class="text-input small-input {validate: {required: true}}" type="text" name="numero" value="<?php echo $r->numero;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>Complemento</label>
                        <input class="text-input small-input {validate: {required: false}}" type="text" name="complemento" value="<?php echo $r->complemento;?>" />
                   </p>
                   <p>
                        <label>Bairro</label>
                        <input class="text-input small-input {validate: {required: true}}" type="text" name="bairro" value="<?php echo $r->bairro;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>CEP</label>
                        <input class="text-input small-input {validate: {required: true}}" type="text" name="cep" value="<?php echo $r->cep;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>Estado</label>
                        <?php echo uf_dropdown('uf', $r->uf, '{validate: {required: true}}');?>
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>Cidade</label>
                        <input class="text-input small-input {validate: {required: true}}" type="text" name="cidade" value="<?php echo $r->cidade;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>Telefone</label>
                        <input class="text-input {validate: {required: true}}" type="text" name="telefone" value="<?php echo $r->telefone;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>E-mail</label>
                        <input class="text-input small-input {validate: {required: true, email: true}}" type="text" name="email" value="<?php echo $r->email;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>Nome do curso</label>
                        <input class="text-input small-input {validate: {required: true}}" type="text" name="nome_curso" value="<?php echo $r->nome_curso;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>N&iacute;vel do curso</label>
                        <input class="text-input small-input {validate: {required: true}}" type="text" name="nivel_curso" value="<?php echo $r->nivel_curso;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>Semestre do curso (ex. 2011.1)</label>
                        <input class="text-input {validate: {required: true}}" type="text" name="senestre_curso" value="<?php echo $r->senestre_curso;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                        <label>Dura&ccedil;&atilde;o do curso</label>
                        <input class="text-input {validate: {required: true}}" type="text" name="duracao_curso" value="<?php echo $r->duracao_curso;?>" />
                        <br /><small>*Obrigat&oacute;rio</small>
                   </p>
                   <p>
                       <input class="button" type="submit" value="Salvar" />
                   </p>
                    
                </fieldset>
                
                <div class="clear"></div><!-- End .clear -->
                
            </form>
            
        </div> <!-- End #tab2 -->        
        
    </div> <!-- End .content-box-content -->
    
</div> <!-- End .content-box -->

<div class="clear"></div>